%entry,
entry {
  %entry_basic, & {
    min-height: $medium_size;
    padding-left: $base_padding * 1.5;
    padding-right: $base_padding * 1.5;
    border-radius: $button_radius;
    border-spacing: $base_padding;
    background-color: $button_color;
    background-clip: padding-box;
    caret-color: currentColor;

    @include focus-ring($focus-state: ':focus-within');

    .osd &:focus-within {
      outline-color: $osd_focus_color;
    }

    > text {
      > placeholder {
        @extend .dim-label;
      }

      > block-cursor {
        color: $view_bg_color;
        background-color: $view_fg_color;
      }
    }

    &.flat {
      &:focus-within, &:disabled, & {
        min-height: 0;
        padding: 2px;
        background-color: transparent;
        box-shadow: none;
        border-radius: 0;
      }
    }

    &:disabled { filter: opacity($disabled_opacity); }

    // entry error and warning style
    @each $e_type, $e_color in (error,   $error_color),
                               (warning, $warning_color),
                               (success, $success_color) {
      &.#{$e_type} {
        @include focus-ring($focus-state: ':focus-within', $fc: gtkalpha(currentColor, $focus_border_opacity));

        > text {
          > selection:focus-within { background-color: gtkalpha($e_color, .2); }

          > cursor-handle > contents { background-color: currentColor; }
        }

        > progress > trough > progress {
          border-color: currentColor;
        }
      }
    }

    > image { // icons inside the entry
      opacity: .7;

      &:hover { opacity: 1; }

      &:active {
        opacity: .8;
      }

      &.left { margin-right: $base_padding; }
      &.right { margin-left: $base_padding; }
    }

    &.password image.caps-lock-indicator {
      opacity: $dimmer_opacity;
    }

    &:drop(active) {
      &:focus-within, & {
        border-color: $drop_target_color;
        box-shadow: inset 0 0 0 1px $drop_target_color;
      }
    }
  }

  > progress {
    margin-bottom: $base_padding / 2;

    > trough > progress {
      background-color: transparent;
      background-image: none;
      border-radius: 0;
      border-width: 0 0 2px;
      border-color: $accent_bg_color;
      border-style: solid;
      box-shadow: none;
    }
  }

  .osd & > progress > trough > progress {
    border-color: $osd_fill_bg_color;
  }
}
